#pragma once
#include <vector>
#include <opencv2\opencv.hpp>
using namespace cv;
using namespace std;

typedef struct RECT_STRU
{
	int x;
	int y;
	int width;
	int height;
}RECT_STRU, *PRECT_STRU;

typedef struct HAARECT_STRU
{
	Rect Rects[4];
	float weight[4];
}HAARECT_STRU, *PHAARECT_STRU;


struct TRAIN_SAMPLE
{
public:
	vector<float> feat;
	int label;
	float weight;
};


void readTxtToVector(string filename, vector<string>* pImagePath, vector<int>* pLabel = NULL);
void LoadData(char* filename, vector<vector<float>>& feats, vector<int>& labels);
float OverLapRate(const Rect& rect1, const Rect& rect2);
vector<pair<Rect, float>> NonMaximumSuppression(vector<pair<Rect, float>>& vcProposal, float thre);


template <typename Dtype>
void DeleteElemFromVector(vector<Dtype>& dataSet, int Index)
{
	vector<Dtype>::iterator it = dataSet.begin();
	dataSet.erase(it + Index);
}

